package com.ruoyi.basic.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 定额工日/实际工日单价对象 tb_daily_unit_price
 * 
 * @author ruoyi
 * @date 2022-09-04
 */
@TableName("tb_daily_unit_price")
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class TbDailyUnitPrice extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId
    @TableField("`id`")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    /** 类型（1：定额工日单价 2：实际工日单价） */
    @Excel(name = "类型", readConverterExp = "1=：定额工日单价,2=：实际工日单价")
    @TableField("`type`")
    @NotNull(message = "类型不能为空")
    private Integer type;

    /** 单价日期 */
    @JsonFormat(pattern = "yyyy-MM")
    @Excel(name = "单价日期", width = 30, dateFormat = "yyyy-MM")
    @TableField("`unit_price_date`")
    @NotNull(message = "单价日期不能为空")
    private Date unitPriceDate;

    @TableField(exist = false)
    List<TbDailyUnitPriceDetail> detailList;

    @TableField(exist = false)
    List<TbDailyUnitPriceDetailReal> detailRealList;

    @TableField(exist = false)
    private String beginDate;

    @TableField(exist = false)
    private String endDate;

    @TableField(exist = false)
    private Long categoryId;

    @TableField(exist = false)
    private Long unitPriceId;
}
